<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>button hover样式</title>
  <style>
    .pesudo {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 120px;
      padding: 60px;
      text-align: center;
      color: white;
      font-size: 200%;
      border-radius: 1em;
      background: #00aabb;
      cursor: pointer;
    }

    .pesudo:before {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: -1;
      border-radius: 1em;
      background: rgba(0, 0, 0, .1);
    }

    /* hover的时候添加样式 ，对于定位伪元素有content样式就会生效*/
    .pesudo:hover:before {
      content: "";
    }

    .pesudo:after {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: -1;
      border-radius: 1em;
      background: rgba(255, 255, 255, .2);
    }

    /* active的时候添加样式 ，对于定位伪元素有content样式就会生效*/

    .pesudo:active:after {
      content: "";
    }
  </style>
</head>

<body>
  <div class="pesudo">hover</div>
</body>

</html>